﻿using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RepositoryService
{
    public class ConnectionEntityPepository : DbContext<DbConnectionEntity>
    {
        public async Task<int> GetMaxId()
        {
            DbConnectionEntity dbConnectionEntity = await this.DB.Queryable<DbConnectionEntity>().OrderBy(t => t.Id, SqlSugar.OrderByType.Desc).FirstAsync();
            if (dbConnectionEntity != null)
            {
                return dbConnectionEntity.Id;
            }
            return -1;
        }
    }
}
